package com.smart.model.convert;

import com.smart.model.dtomapper.OperatePermissionDtoMapper;
import com.smart.model.domain.OperatePermissionDO;
import com.smart.model.vo.OperatePermissionVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class OperatePermissionConvert {

    public static List<OperatePermissionVO> buildOperatePermissionVoList(List<OperatePermissionDO> operatePermissionDOList) {
        if (CollectionUtils.isEmpty(operatePermissionDOList)) {
            return Lists.newArrayList();
        }
        List<OperatePermissionVO> operatePermissionVOList = new ArrayList<>();
        for (OperatePermissionDO operatePermissionDO : operatePermissionDOList) {
            operatePermissionVOList.add(OperatePermissionDtoMapper.INSTANCE.do2VO(operatePermissionDO));
        }

        return operatePermissionVOList;
    }
}
